package com.czq.controller;

import com.czq.common.ResultJson;
import com.czq.domain.Menu;
import com.czq.service.MenuService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Czq
 * @version V1.0.0
 * @Date 2024/1/17 14:36
 */
@RestController
@RequestMapping("/menu")
@Slf4j
public class MenuController {

    @Resource
    private MenuService menuService;

    @GetMapping("/list")
    public ResultJson list() {
        List<Menu> menuList = menuService.listMenu();
        log.info("menuList{}",menuList);
        return ResultJson.success(menuList);
    }
}
